package i18n;

import java.util.Locale;
import java.util.PropertyResourceBundle;

public class I18NResolver {

    private I18NResolver() {}  // Don't allow instantiation!
    private static Locale loc;
    
	public static String t(String key) {
        return PropertyResourceBundle.getBundle("resources", loc).getString(key);
	}
	
	public static void setLocale(Locale l) {
		loc = l;
	}
	
	public static String test() {
		return I18NResolver.t("app.title");
	}
	
	public static void main (String [] args) {
		I18NResolver.setLocale(new Locale("PL"));
		System.out.println(I18NResolver.t("app.title"));
		I18NResolver.setLocale(Locale.ENGLISH);
		System.out.println(I18NResolver.t("app.title"));
		
	}
}
